package com.xiaoxi.logserver.domain.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @Author xiaoxi
 * @ProjectName bms
 * @PackageName com.xiaoxi.bms.domain.log.vo
 * @ClassName BMSLogLoginVO
 * @Description TODO
 * @Date 2022/11/2 15:56
 * @Version 1.0
 */
@Data
public class BMSLogLoginVO implements Serializable {

    /**
     * 序号
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户名
     */
    private String username;

    /**
     * 访问ip地址
     */
    private String ip;

    /**
     * 响应体
     */
    private String apiResponse;

    /**
     * 登录日志
     */
    private String message;


    /**
     * 响应编码
     */
    private String code;

    /**
     * 登录时间
     */
    private LocalDateTime loginTime;

    /**
     * 登录状态 true 成功 false 失败
     */
    private Boolean status;

    @Override
    public String toString() {

        String statusMessage = status ? "登录成功" : "登录失败";

        return id + "☆" + username + "☆" + "☆" + ip + "☆" + loginTime
                + "☆" + apiResponse + "☆" + message + "☆" + code + "☆" + statusMessage;

    }
}
